package com.example.juc.singe;

import java.util.concurrent.atomic.AtomicInteger;

public class EMan {
    private EMan(){}
    private EMan eMan =new EMan();
    public EMan Test(){
        return eMan;
    }

    public static void main(String[] args) {
        AtomicInteger num =new AtomicInteger(2020);
//到达期望值就就更新 要不就不更新     期望值    更新值
        num.compareAndSet(2020,2021);
        System.out.println(num.get());
    }
}
